package com.dz.content.controller;

import com.dz.common.base.BaseApiService;
import com.dz.common.base.ResponseBase;
import com.dz.content.domain.vo.ContentResultsVO;
import com.dz.content.service.ContentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName : ContentController
 * @Description :
 * @Author : ming
 * @Date: 2020-12-14 10:56
 **/
@RestController
@RequestMapping("/content")
@Api(tags = "广告管理")
public class ContentController  extends BaseApiService {

    @Autowired
    private ContentService contentService;

    @GetMapping("/getList")
    @ApiOperation(value = "根据分类id查询广告")
    public ResponseBase findByCategoryId(Long categoryId) throws Exception {
        List<ContentResultsVO> list = contentService.findByCategoryId(categoryId);
        return setResultSuccess(list) ;
    }
}
